package com.yunc.modules.cms.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yunc.modules.cms.entity.CmsArticle;
import com.yunc.modules.cms.mapper.CmsArticleMapper;
import com.yunc.modules.cms.service.ICmsArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 文章
 *
 * @author congcong tao
 * @date 2018/12/3 17:39
 */
@Service("CmsArticleService")
public class CmsArticleServiceImpl extends ServiceImpl<CmsArticleMapper, CmsArticle> implements ICmsArticleService {

    @Autowired
    private CmsArticleMapper cmsArticleMapper;

    @Override
    public IPage<CmsArticle> pageInfo(Page<CmsArticle> page, CmsArticle cmsArticle) {
        return cmsArticleMapper.pageInfo(page, cmsArticle.getTitle(), cmsArticle.getAuthor(), cmsArticle.getCategoryCode());
    }

    @Override
    public CmsArticle getEntityById(Long id) {
        return cmsArticleMapper.getEntityById(id);
    }
}
